package manager

const (
	ERROR           = 1
	SUCCESS         = "成功"
	ReachedMaxTasks = "已达到最大可运行的任务数"
)

type CreateReq struct {
	TaskID     string
	Operator   string `form:"operator"`
	Country    string `form:"country"`
	AreaCode   string `form:"area_code"`
	Phones     string `form:"phones"`
	UploadType string `form:"upload_type,default=file"`
}

type CreateRsp struct {
	TaskID       string `json:"task_id"`
	TotalCount   int    `json:"total_count"`
	ValidCunt    int    `json:"valid_cunt"`
	InValidCount int    `json:"invalid_cunt"`
}

type GetTaskDetailReq struct {
	TaskID string `form:"task_id"`
}

type GetTaskListReq struct {
	State  int  `form:"state"`
	pNo    int  `form:"page_index"`
	pSize  int  `form:"page_size"`
	Detail bool `form:"detail"`
}

type ControlReq struct {
	Op     string `form:"op"`
	TaskID string `form:"task_id"`

	/* 操作优先级用到的参数 */
	FromID        string `form:"from_task_id"`
	ToID          string `form:"to_task_id"`
	BeforeOrAfter int    `form:"before_or_after,string"`
	/* 操作优先级用到的参数 */

	SetConcurrency int `form:"number"`
}

type SettingsReq map[string]interface{}

type Response struct {
	Code    int         `json:"code"`
	Result  interface{} `json:"result"`
	Message string      `json:"message"`
}

type GetClusterListReq struct {
}

type RedisParams struct {
	Addr          string
	Pwd           string
	DB            int
	Prefix        string
	Separator     string
	MaxConn       int
	Channel       string
	DetailChannel string
}

type SieveImplParams struct {
	RedisParams RedisParams
}

type PaginationResult struct {
	Total     int64 `json:"total"`
	PageIndex int   `json:"page_index"`
	PageSize  int   `json:"page_size"`
}

type TaskInfoWithPagination struct {
	Pagination *PaginationResult `json:"pagination,omitempty"`
	List       []interface{}     `json:"list"`
}
